/*
 * ZonalMean.java
 *
 * Created on February 28, 2005, 8:07 PM
 */

package edu.temple.GUS.MMA.Functions;
import java.util.*;
import edu.temple.GUS.MMA.DataTypes.*;
import edu.temple.GUS.MMA.Exceptions.MMAFunctionInitException;
import edu.temple.GUS.MMA.Functions.ZonalLoop;
import edu.temple.GUS.MMA.Functions.ZonalFunctions;

/**
 *
 * @author  rkhanna
 */
public class ZonalMean {
    
    /** Creates a new instance of ZonalMean */
    public ZonalMean() 
    {
    }

    public Hashtable execute(MMATimeSeries tSeries1, MMATimeSeries tSeries2) throws MMAFunctionInitException    
    {        
        ZonalLoop zonalobj = new ZonalLoop();
        Hashtable ht_multiple_val = zonalobj.loopTimeSeries_TimeSeries(tSeries1, tSeries2);
        ZonalFunctions funcobj = new ZonalFunctions();
        Hashtable ht_single_val = funcobj.calculateZonalAdd(ht_multiple_val);
        return ht_single_val;        
    }
    
    
    public Hashtable execute(MMATimeSeries tSeries, MMATimeCube tCube) throws MMAFunctionInitException
    {        
        ZonalLoop zonalobj = new ZonalLoop();
        Hashtable ht_multiple_val = zonalobj.loopTimeSeries_TimeCube(tSeries, tCube);        
        ZonalFunctions funcobj = new ZonalFunctions();
        Hashtable ht_single_val = funcobj.calculateZonalAdd(ht_multiple_val);
        return ht_single_val;        
    }
    
    
    public Hashtable execute(MMATimeSeries tSeries, MMAHyperCube hCube) throws MMAFunctionInitException    
    {        
        ZonalLoop zonalobj = new ZonalLoop();
        Hashtable ht_multiple_val = zonalobj.loopTimeSeries_HyperCube(tSeries, hCube);
        ZonalFunctions funcobj = new ZonalFunctions();
        Hashtable ht_single_val = funcobj.calculateZonalAdd(ht_multiple_val);
        return ht_single_val;                
    }
    
    public Hashtable execute(MMAGrid grid1, MMAGrid grid2) throws MMAFunctionInitException    
    {
        ZonalLoop zonalobj = new ZonalLoop();
        Hashtable ht_multiple_val = zonalobj.loopGrid_Grid(grid1, grid2);    
        ZonalFunctions funcobj = new ZonalFunctions();
        Hashtable ht_single_val = funcobj.calculateZonalAdd(ht_multiple_val);
        return ht_single_val;
    }        
   
    
    public Hashtable execute(MMAGrid grid, MMATimeCube tCube) throws MMAFunctionInitException    
    {        
        ZonalLoop zonalobj = new ZonalLoop();
        Hashtable ht_multiple_val = zonalobj.loopGrid_TimeCube(grid, tCube);    
        ZonalFunctions funcobj = new ZonalFunctions();
        Hashtable ht_single_val = funcobj.calculateZonalAdd(ht_multiple_val);
        return ht_single_val;        
    }
    
    public Hashtable execute(MMAGrid grid, MMASpaceCube sCube) throws MMAFunctionInitException    
    {        
        ZonalLoop zonalobj = new ZonalLoop();
        Hashtable ht_multiple_val = zonalobj.loopGrid_SpaceCube(grid, sCube);    
        ZonalFunctions funcobj = new ZonalFunctions();
        Hashtable ht_single_val = funcobj.calculateZonalAdd(ht_multiple_val);
        return ht_single_val;        
    }

    public Hashtable execute(MMAGrid grid, MMAHyperCube hCube) throws MMAFunctionInitException    
    {        
        ZonalLoop zonalobj = new ZonalLoop();
        Hashtable ht_multiple_val = zonalobj.loopGrid_HyperCube(grid, hCube);    
        ZonalFunctions funcobj = new ZonalFunctions();
        Hashtable ht_single_val = funcobj.calculateZonalAdd(ht_multiple_val);
        return ht_single_val;                
    }
    
    public Hashtable execute(MMASpaceCube sCube1, MMASpaceCube sCube2) throws MMAFunctionInitException    
    {
        ZonalLoop zonalobj = new ZonalLoop();
        Hashtable ht_multiple_val = zonalobj.loopSpaceCube_SpaceCube(sCube1, sCube1);    
        ZonalFunctions funcobj = new ZonalFunctions();
        Hashtable ht_single_val = funcobj.calculateZonalAdd(ht_multiple_val);
        return ht_single_val;                                
    }
    
    public Hashtable execute(MMASpaceCube sCube, MMAHyperCube hCube) throws MMAFunctionInitException    
    {        
        ZonalLoop zonalobj = new ZonalLoop();
        Hashtable ht_multiple_val = zonalobj.loopSpaceCube_HyperCube(sCube, hCube);    
        ZonalFunctions funcobj = new ZonalFunctions();
        Hashtable ht_single_val = funcobj.calculateZonalAdd(ht_multiple_val);
        return ht_single_val;                                
    }

    public Hashtable execute(MMATimeCube tCube1, MMATimeCube tCube2) throws MMAFunctionInitException    
    {
        ZonalLoop zonalobj = new ZonalLoop();
        Hashtable ht_multiple_val = zonalobj.loopTimeCube_TimeCube(tCube1, tCube2);    
        ZonalFunctions funcobj = new ZonalFunctions();
        Hashtable ht_single_val = funcobj.calculateZonalAdd(ht_multiple_val);
        return ht_single_val;                                
    }

    public Hashtable execute(MMATimeCube tCube, MMAHyperCube hCube) throws MMAFunctionInitException    
    {        
        ZonalLoop zonalobj = new ZonalLoop();
        Hashtable ht_multiple_val = zonalobj.loopTimeCube_HyperCube(tCube, hCube);    
        ZonalFunctions funcobj = new ZonalFunctions();
        Hashtable ht_single_val = funcobj.calculateZonalAdd(ht_multiple_val);
        return ht_single_val;                                        
    }
    
    public Hashtable execute(MMAHyperCube hCube1, MMAHyperCube hCube2) throws MMAFunctionInitException    
    {        
        ZonalLoop zonalobj = new ZonalLoop();
        Hashtable ht_multiple_val = zonalobj.loopHyperCube_HyperCube(hCube1, hCube2);
        ZonalFunctions funcobj = new ZonalFunctions();
        Hashtable ht_single_val = funcobj.calculateZonalAdd(ht_multiple_val);
        return ht_single_val;                                               
    }    
    
}
